/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wwcontrolserver.sensor;

/**
 *
 * @author Michael Ferry
 */
//This uses the ifkSerial and the ratiometric state of the sensor as a key.  It will likely not
//be unique but this is useful for sorting sensors of a given type attached to an IFK
public class SensorRKey {

    private int ifkSerial;
    private boolean ratiometric;

    public SensorRKey(int ifkIN, boolean ratiometric) {
        this.ifkSerial = ifkIN;
        this.ratiometric = ratiometric;
    }

    public int GetIFK() {
        return ifkSerial;
    }

    public boolean GetRatiometric() {
        return ratiometric;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 97 * hash + this.ifkSerial;
        hash = 97 * hash + (this.ratiometric ? 1 : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final SensorRKey other = (SensorRKey) obj;
        if (this.ifkSerial != other.ifkSerial) {
            return false;
        }
        if (this.ratiometric != other.ratiometric) {
            return false;
        }
        return true;
    }
}
